@echo off
setlocal
echo Setting Environment vars
set CUR_DIR=%~dp0
call "%CUR_DIR%setBuildEnv.bat"

REM Set the environment
set WL_HOME=E:\dev\wlp10gr3\wlserver_10.3
SET JAVA_VENDOR=Sun
SET JAVA_HOME=E:\dev\wlp10gr3\jdk160_05
call "%WL_HOME%\server\bin\setWLSEnv.cmd"

set WL_ADM_URL=t3://localhost:10301
set WL_USER=weblogic
set WL_PWD=weblogic
set WL_TARGET=AdminServer

REM undeploy the webapplication
java -cp %CLASSPATH% weblogic.Deployer -undeploy -name wstt -username %WL_USER% -password %WL_PWD% -verbose -debug -timeout 600 -adminurl %WL_ADM_URL%

REM deploy the webapplication
java -cp %CLASSPATH% weblogic.Deployer -deploy -upload %CUR_DIR%\target\wstt.war -name wstt -username %WL_USER% -password %WL_PWD% -verbose -debug -timeout 600 -adminurl %WL_ADM_URL% -targets %WL_TARGET%

pause